package com.spring.shops.dao;

import com.spring.shops.model.dto.OrderPageDTO;
import com.spring.shops.model.entity.TzOrder;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TzOrderMapper {
    int deleteByPrimaryKey(Long orderId);

    int insert(TzOrder record);

    int insertSelective(TzOrder record);

    TzOrder selectByPrimaryKey(Long orderId);

    int updateByPrimaryKeySelective(TzOrder record);

    int updateByPrimaryKey(TzOrder record);

    List<TzOrder> selectByPageSearch(OrderPageDTO orderPageDTO);

    @Select("select * from tz_order where order_number=#{id}")
    TzOrder selectByOrderNumber(long id);

    @Select("select shop_id from tz_order where status=2")
    List<Integer> selectByStatus();
    @Select("select * from tz_order where status=2 and shop_id=#{shopId}")
    List<TzOrder> selectByShopId(Long shopId);

    @Select("select * from tz_order where is_payed=1")
    List<TzOrder> selectByIsPayed();

}